/**
 * object
 */

//定义对象  name age 属性 其他属性不强制

// let user:object = {name:"张三",age:18}
// let user:{name:string,age?:number} = {name:"张三",age:18}

//问号表示可选属性 
// let user:{name:string,age?:number} = {name:"张三"}



//索引签名
let user:{
    name:string,
    age?:number,
    
    
    
    // address:string,
    // tel:number
     [key: string]: any // 索引签名，完全可以不⽤key这个单词，换成其他的也可以 



} = {name:"张三",age:18,address:'',tel:138888}


console.log(user);

let str: string  = ''